package com.liusaidh;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

/**
 * @author liusaidh
 * @date 2024/5/15 23:07
 * @description  启动类
 */
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@MapperScan("com.liusaidh.mapper")
public class WeiboApplication implements CommandLineRunner {
    public static void main(String[] args) {
        SpringApplication.run(WeiboApplication.class, args);
    }

    /**
     * 启动项目自动跳转到首页
     */
    @Override
    public void run(String...args) {
        try {
            Runtime.getRuntime().exec("cmd /c start http://localhost:80/weibo/");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}
